package com.bdqn.t320.ch12.config;

import com.bdqn.t320.ch12.entity.City;
import com.bdqn.t320.ch12.entity.Street;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {

    @Bean
    public Street aaaa() {
        return new Street(1,"人民西路");
    }

    @Bean
    public City chenzhou(){
        City city = new City();
        city.setId(100);
        city.setName("郴州");
        city.setStreet(aaaa());
        return city;
    }
}
